package cn.circle.system.dao.impl;

import java.util.List;

import org.hibernate.Query;
import org.springframework.stereotype.Repository;

import com.graduation.system.model.SysCustomer;
import com.graduation.system.model.SysNotice;

import cn.circle.commom.dao.impl.BaseDaoImpl;
import cn.circle.system.dao.ISysNoticeDao;
import cn.circle.system.util.DataGrid;
import cn.circle.system.util.PageHelper;

@Repository
public class SysNoticeDao extends BaseDaoImpl<SysNotice> implements ISysNoticeDao {

	@Override
	public List<SysNotice> datagrid() {
		// TODO Auto-generated method stub
		String hql = "from SysNotice ";
		Query query = super.sessionFactory.getCurrentSession().createQuery(hql);
		return query.list();
	}

	@Override
	public List<SysNotice> getUser(String id) {
		// TODO Auto-generated method stub
		String hql = "from SysNotice where noticeID = '"+id+"'";
		Query query = super.sessionFactory.getCurrentSession().createQuery(hql);
		return query.list();
	}

	@Override
	public boolean updataAll(SysNotice c) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public boolean deleteAll(String custIds) {
		// TODO Auto-generated method stub
		String hql = "delete SysNotice s where s.noticeID in ("+custIds+") ";
		Query query = super.sessionFactory.getCurrentSession().createQuery(hql);
		return (query.executeUpdate() > 0);
	}


}
